package com.duobaoyu.dby.supply.api;

import com.duobaoyu.dby.channel.starter.annotation.EnableSupplyChannel;
import com.duobaoyu.dby.channel.starter.processor.MockBeanDefinitionRegistryPostProcessor;
import com.duobaoyu.dby.common.feign.annotation.EnableDbyFeignClients;
import com.duobaoyu.dby.common.security.annotation.EnableDbyResourceServer;
import com.duobaoyu.dby.supply.biz.constant.SupplyChainConstants;
import com.duobaoyu.dby.supply.biz.exception.SupplyChainBizException;
import com.duobaoyu.dby.supply.core.cache.annotation.EnableMultilevelCaching;
import com.duobaoyu.dby.supply.core.common.annotation.EnableDbyDynamicTp;
import com.duobaoyu.dby.supply.core.common.annotation.EnableException;
import com.duobaoyu.dby.supply.core.delay.annotation.EnableRedisson;
import com.duobaoyu.dby.supply.core.feign.annotation.EnableDbySupplyFeign;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;

/**
 * 启动类
 *
 * @author fengshaoyu
 * @version 1.0.0
 * @date 2023/9/25 16:47
 */
@Slf4j
@EnableAsync
@EnableRedisson
@EnableDbyDynamicTp
@EnableSupplyChannel
@EnableDiscoveryClient
@EnableDbyFeignClients
@EnableDbyResourceServer
@EnableMultilevelCaching
@Import(MockBeanDefinitionRegistryPostProcessor.class)
@EnableException(exceptionClass = SupplyChainBizException.class)
@EnableDbySupplyFeign(bizCode = SupplyChainConstants.SUPPLY_CHAIN)
@EnableAspectJAutoProxy(exposeProxy = true, proxyTargetClass = true)
@MapperScan(basePackages = "com.duobaoyu.dby.supply.db.mapper", annotationClass = Mapper.class)
@SpringBootApplication(scanBasePackages = {"com.duobaoyu.dby.supply.db", "com.duobaoyu.dby.supply.biz", "com.duobaoyu.dby.supply.api"})
public class SupplyChainApiApplication {

	public static void main(String[] args) {
		SpringApplication.run(SupplyChainApiApplication.class, args);
		log.info("-----------------------供应链业务项目启动-------------------------");
	}
}
